package com.ruoyi.factorydata.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.factorydata.domain.CraftProcessRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工艺工序Mapper接口
 *
 * @author ruoyi
 * @date 2025-07-15
 */
public interface CraftProcessRelationMapper extends BaseMapper<CraftProcessRelation> {
    /**
     * 查询工艺工序
     *
     * @param id 工艺工序主键
     * @return 工艺工序
     */
    public CraftProcessRelation selectCraftProcessRelationById(Long id);

    /**
     * 查询工艺工序列表
     *
     * @param craftProcessRelation 工艺工序
     * @return 工艺工序集合
     */
    public List<CraftProcessRelation> selectCraftProcessRelationList(CraftProcessRelation craftProcessRelation);

    /**
     * 新增工艺工序
     *
     * @param craftProcessRelation 工艺工序
     * @return 结果
     */
    public int insertCraftProcessRelation(CraftProcessRelation craftProcessRelation);

    /**
     * 修改工艺工序
     *
     * @param craftProcessRelation 工艺工序
     * @return 结果
     */
    public int updateCraftProcessRelation(CraftProcessRelation craftProcessRelation);

    /**
     * 删除工艺工序
     *
     * @param id 工艺工序主键
     * @return 结果
     */
    public int deleteCraftProcessRelationById(Long id);

    /**
     * 批量删除工艺工序
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCraftProcessRelationByIds(Long[] ids);

    /**
     * 根据工艺路线id和步骤查询工艺工序
     *
     * @param craftRouteId 工艺路线id
     * @param step 步骤
     * @return 工艺工序
     */
    CraftProcessRelation selectProcessStep(@Param("craftRouteId") Long craftRouteId, @Param("step")int step);
}